Skip to content

Fix bug #52335: fseek() on memory stream behavior different than file - #12058

Closed
bukka wants to merge 1 commit into
php:masterfrom
bukka:stream_memory_seek_past_end
Closed

bukka wants to merge 1 commit into
php:masterfrom
bukka:stream_memory_seek_past_end

Conversation

@bukka

@bukka bukka commented Aug 27, 2023 •

Copy link
Copy Markdown
Member

This changes memory stream to allow seeking past end which makes it the same as seeking on files. It means the position is allowed to be higher than the string length. The size only increases if data is appended to the past position. The space between the previous string and position is filled with zero bytes.

Except other things this also allows seeking on php://input before data is written into it and thus fixes #9441.

@bukka bukka changed the title Fix bug #52335 (fseek() on memory stream behavior different then file) Fix bug #52335 (fseek() on memory stream behavior different than file) Aug 27, 2023
@bukka bukka changed the title Fix bug #52335 (fseek() on memory stream behavior different than file) Fix bug #52335: fseek() on memory stream behavior different than file Aug 27, 2023
@bukka bukka closed this in ba9650d Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fseek does not work with php://input when data is not pre-read

1 participant